//
//  PatienData.m
//  StraightTrain
//
//  Created by mk on 15/11/27.
//  Copyright © 2015年 mk. All rights reserved.
//

#import "PatienUserData.h"

@implementation PatienUserInfoData

-(id)init
{
    if (self = [super init])
    {
        self.urlPath = @"";
        self.strDataKey = requestDataKey;
    }
    return self;
}

-(void)parseData:(id)dataObj
{
    [super parseData:dataObj];
    
    if ([dataObj isKindOfClass:[NSDictionary class]])
    {
        self.patien_id = NullObjToString(dataObj[@"id"]);
        self.patien_name = NullObjToString(dataObj[@"name"]);
        self.patien_age = NullObjToString(dataObj[@"age"]);
        self.patien_ageMonth = NullObjToString(dataObj[@"ageMonth"]);
        self.patien_cityName = NullObjToString(dataObj[@"cityName"]);
        self.patien_gender = NullObjToString(dataObj[@"gender"]);
        self.patien_mobile = NullObjToString(dataObj[@"mobile"]);
        self.patien_diseaseName = NullObjToString(dataObj[@"diseaseName"]);
        self.patien_dateUpdated = NullObjToString(dataObj[@"dateUpdated"]);
        self.patien_diseaseDetail = NullObjToString(dataObj[@"diseaseDetail"]);
        
        self.patien_birthMonth = NullObjToString(dataObj[@"birthMonth"]);//出生月
        self.patien_birthYear = NullObjToString(dataObj[@"birthYear"]);//出生年
        self.patien_stateName = NullObjToString(dataObj[@"stateName"]);//省
    }
}


@end


@implementation PatienUserListData

-(id)init
{
    if (self = [super init])
    {
        self.urlPath = @"";
        self.strDataKey = requestDataKey;
    }
    return self;
}

-(void)parseData:(id)dataObj
{
    [super parseData:dataObj];
    
    if ([dataObj isKindOfClass:[NSArray class]])
    {
        for (int i = 0; i < [dataObj count]; i++) {
            NSDictionary *dicRec = [dataObj objectAtIndex:i];
            PatienUserInfoData *recData = [[PatienUserInfoData alloc] init];
            [recData parseData:dicRec];
            [self.dataArray addObject:recData];
        }
    }
}


@end


